package com.z100h.supplychain.order.entity;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.core.persistence.DataEntity;
import com.z100h.supplychain.order.enums.OrderApprovalState;
import com.z100h.supplychain.order.enums.OrderWorkflow;
import com.z100h.supplychain.order.enums.RentType;

/**
 * 
 * [描述信息：说明类的基本功能]
 *
 * @author Elvin Zhao - 279152260@qq.com
 * @version 1.0 Created on 2022年3月1日 下午5:09:58
 */
public class OrderVo extends DataEntity<OrderVo> {

	private static final long serialVersionUID = 1L;

	private String no;

	private String rentTypeValue;

	private String rentType;

	private String stockroomName;

	private String state;

	private String workflowState;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date qcDate;

	private String createName;

	private String startDate;

	private String endDate;

	/**
	 *
	 * @return 
	 */
	public String getRentTypeValue() {
		return rentTypeValue;
	}

	/**
	 *
	 * @param rentTypeValue
	 */
	public void setRentTypeValue(String rentTypeValue) {
		this.rentTypeValue = rentTypeValue;
	}

	/**
	 *
	 * @return 
	 */
	public String getCreateName() {
		return createName;
	}

	/**
	 *
	 * @param createName
	 */
	public void setCreateName(String createName) {
		this.createName = createName;
	}

	/**
	 *
	 * @return 
	 */
	public String getStartDate() {
		return startDate;
	}

	/**
	 *
	 * @param startDate
	 */
	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	/**
	 *
	 * @return 
	 */
	public String getEndDate() {
		return endDate;
	}

	/**
	 *
	 * @param endDate
	 */
	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}

	/**
	 *
	 * @return 
	 */
	public String getNo() {
		return no;
	}

	/**
	 *
	 * @param no
	 */
	public void setNo(String no) {
		this.no = no;
	}

	/**
	 *
	 * @return 
	 */
	public String getRentType() {

		if (StringUtils.isNotBlank(rentType)) {
			return RentType.get(rentType).getName();

		} else {
			return null;
		}

	}

	/**
	 *
	 * @param rentType
	 */
	public void setRentType(String rentType) {
		this.rentType = rentType;
	}

	/**
	 *
	 * @return 
	 */
	public String getStockroomName() {
		return stockroomName;
	}

	/**
	 *
	 * @param stockroomName
	 */
	public void setStockroomName(String stockroomName) {
		this.stockroomName = stockroomName;
	}

	/**
	 *
	 * @return 
	 */
	public String getState() {
		if (StringUtils.isNotBlank(state)) {
			return OrderApprovalState.get(state).getName();
		} else {
			return null;
		}
	}

	/**
	 *
	 * @param state
	 */
	public void setState(String state) {
		this.state = state;
	}

	/**
	 *
	 * @return 
	 */
	public String getWorkflowState() {
		if (StringUtils.isNotBlank(workflowState)) {
			return OrderWorkflow.get(workflowState).getName();
		} else {
			return null;
		}
	}

	/**
	 *
	 * @param workflowState
	 */
	public void setWorkflowState(String workflowState) {
		this.workflowState = workflowState;
	}

	/**
	 *
	 * @return 
	 */
	public Date getQcDate() {
		return qcDate;
	}

	/**
	 *
	 * @param qcDate
	 */
	public void setQcDate(Date qcDate) {
		this.qcDate = qcDate;
	}

	/**
	 * 
	 */
	public OrderVo() {
		super();
	}

	/**
	 * @param id
	 */
	public OrderVo(String id) {
		super(id);
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
	}

}